package me.boot.gen.uid.condition;

import cn.hutool.core.util.StrUtil;
import me.boot.gen.uid.propertites.UidType;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;


public class HutoolIdCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        String uidType = context.getEnvironment().getProperty("uid.type");
        return StrUtil.equalsIgnoreCase(uidType, UidType.Hutool.name());
    }
}
